package com.devin.avatar.module.cms.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.devin.avatar.common.controller.BaseController;

@RequestMapping("/hello")
@Controller
public class HelloController extends BaseController
{
    @ResponseBody
    @RequestMapping({"/t1",""})
    public Object test01(Model model)
    {
	Map<String, Object> rv = new HashMap<>();
	rv.put("d1", "Hello, Devin.");
	
	return rv;
    }
    
    @RequestMapping("/t2")
    public void test02(Model model, HttpServletResponse res)
    {
	model.addAttribute("welcome", "Hello, Devin.");
	
	this.renderString(res, model);
    }
    
    @RequestMapping("/t3")
    public String test03(Model model)
    {
	model.addAttribute("welcome", "Hello, Devin.");
	
	return "hello";
    }
}
